home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / bbs / maxut11.zip / MSGLST00.MEX < prev    next >
Text File  |  1996-06-20  |  14KB  |  446 lines

  1.  
  2. //////////////////////////////////////////////////////////////////////////////
  3. // File: arealist.mex
  4. //
  5. // Desc: Program to display a list of message or file areas.  If the
  6. //       MSGAREA constant is defined, this will display a list of
  7. //       message areas.  If FILEAREA is defined, this will display
  8. //       a list of file areas.
  9. // Copyright 1990, 1995 by Lanius Corporation.  All rights reserved.
  10. //
  11. // Free for non-commerical use
  12. // $Id: msglst00.mex 0.0 1996/01/07 17:48:05 sjd Exp $
  13. // Copyright , 1995 1996 by Gerry Ellison.  All rights reserved.
  14. //  change to print and write to.
  15. //  M_Alst03.bbs", Squish.add", TimLst.add" 12/21/1995 Gerry Ellison
  16. //  Use M\msglst00_CON or M\msglst00_WRT
  17. //////////////////////////////////////////////////////////////////////////////
  18.  
  19. #include <max.mh>
  20.  
  21. #define MSGAREA
  22.  
  23. #ifdef FILEAREA
  24. #define ATYPE "file"
  25. #define AREAT _farea
  26. #define ARVAR farea
  27. #define AreaFindFirst fileareafindfirst
  28. #define AreaFindNext  fileareafindnext
  29. #define AreaFindClose fileareafindclose
  30. #define AreaSelect    fileareaselect
  31. #endif
  32.  
  33. #ifdef MSGAREA
  34. #define ATYPE "msg"
  35. #define AREAT _marea
  36. #define ARVAR marea
  37. #define AreaFindFirst msgareafindfirst
  38. #define AreaFindNext  msgareafindnext
  39. #define AreaFindClose msgareafindclose
  40. #define AreaSelect    msgareaselect
  41. #endif
  42.  
  43. int isourdivision(string: divstr, string: areaname)
  44. {
  45.   int:    l;
  46.   string: sub;
  47.  
  48.   l:=strlen(divstr);
  49.   sub:=substr(areaname,1,l);
  50.   if (strupper(sub)<>strupper(divstr))
  51.     return False;
  52.   sub:=substr(areaname,l+2,strlen(areaname)-l-1);
  53.   if (stridx(sub,1,'.'))
  54.     return False;
  55.   return True;
  56. }
  57.  
  58. int main(string: argv)
  59. // int main()
  60. {
  61.  
  62.      int: fd,cn;                                 // for write
  63.      int: done, i, levels, first, divonly;
  64.   string: aname,division,tmp;
  65.     char: nonstop,ch;
  66. // added to print and write C:\Max\Miscx\M_Alst03.bbs
  67.   string: S,A,B,D,F,G,GT,GF,GI,GN,GS,H,L,M,N,O,R,T,V,W,GR,WM,LS,RS,line;
  68.   string: z,tagtp,type,nodes,TMT;               // for squish and timed list
  69.  
  70.   struct AREAT: a;
  71.  
  72.     first:= True;
  73.   divonly:= False;
  74.  
  75. // added to print and write C:\Max\Miscx\M_Alst03.bbs
  76.       GR := "\x16\x01\x07";
  77.       WM := "\x16\x01\x5F";
  78.       LS := WM+"░░░▒▒▒▓▓▓████";
  79.       RS := "████▓▓▓▒▒▒░░░"+GR;
  80.  
  81. // TMT:= LS+"            TMT: Local             "+RS;
  82.     A := LS+" Compression and Archiver Software."+RS;
  83.     B := LS+"  Bulletin Board information msg.  "+RS;
  84.     D := LS+"       Disabled Message Areas.     "+RS;
  85.     F := LS+"    For Sale Local and National.   "+RS;
  86.    GT := LS+"   Genealogy Echo Mail messages.   "+RS;
  87.    GF := LS+" Fido Net International Genealogy  "+RS;
  88.    GI := LS+"IGA_Net<tm> International Genealogy"+RS;
  89.    GN := LS+"    NNS:  Non-Network Specific.    "+RS;
  90.    GS := LS+"           GensysOp Area.          "+RS;
  91.     H := LS+"   Ham Radio Echo Mail messages.   "+RS;
  92.     L := LS+" Languages, & Batch Aids Messages. "+RS;
  93.     M := LS+" Modems and Communication Messages."+RS;
  94.     N := LS+"     Networks and Multtasking.     "+RS;
  95.     O := LS+"            OS2 Messages.          "+RS;
  96.     R := LS+"     Rest of Groups not listed.    "+RS;
  97.     T := LS+"        Tech type  messages.       "+RS;
  98.     V := LS+"     Virus Message Conference.     "+RS;
  99.     W := LS+"         Microsoft Windows.        "+RS;
  100.     S := LS+"     SysOp and Work File Areas.    "+RS;
  101.  
  102. // 1st end to print and write C:\Max\Miscx\M_Alst03.bbs
  103.  
  104. print(COL_YELLOW+"\nConstructing Message.lst, Squish.cfg and Timed.cfg "+
  105.       GR);
  106.  
  107.       if (argv <> "WRT") {
  108.           ch := input_list("yn", 0, "", "",
  109.           "\nDo you want to print to con");
  110.       if (ch = 89)
  111.            argv := "CON";
  112.       }
  113.  
  114.   fd := open("C:\\Max\\Miscx\\M_Alst03.bbs", IOPEN_CREATE | IOPEN_WRITE);
  115.     close(fd);
  116.   fd := open("C:\\Bbs\\Squish\\Squish.add", IOPEN_CREATE | IOPEN_WRITE);
  117.     close(fd);
  118.   fd := open("C:\\Bbs\\Squish\\Timed\\TimLst.add", IOPEN_CREATE | IOPEN_WRITE);
  119.     close(fd);
  120.  
  121.   // Set initial division name
  122.  
  123.   i:=strridx(ARVAR.name,0,'.');
  124.   if (i>0)
  125.     division:=substr(ARVAR.name,1,i-1);
  126.   else
  127.     division:="";
  128.  
  129.   do
  130.   {
  131.     int: len;
  132.  
  133.     len := input_str(aname, INPUT_WORD|INPUT_NOCTRLC|INPUT_DEFAULT,
  134.                            0, 64, COL_WHITE "\nSelect " ATYPE " area: ");
  135.  
  136.     print('\n');
  137.  
  138.     if (len=0)
  139.     {
  140.       if (first<>True)
  141.         return 0;
  142.       aname:="?";
  143.     }
  144.  
  145.     if (aname="..")
  146.     {
  147.       i:=stridx(division,1,'.');
  148.       if (i>0)
  149.         division:=substr(division,1,i-1);
  150.       else
  151.         division:="";
  152.       aname:="?";
  153.     }
  154.  
  155.     if (aname[1]='/')         // Top level list requested
  156.     {
  157.       aname:=substr(aname,2,strlen(aname)-1);
  158.       // List all top level areas
  159.       division:="";
  160.       if (aname[1]=' ')
  161.         aname:="?";
  162.     }
  163.  
  164.     first:=False;
  165.     divonly:=False;
  166.     if (aname[1]='?')         // Area list requested
  167.     {
  168.       aname:=division;
  169.  
  170.       // List just current division
  171.  
  172.       i:=AreaFindFirst(a, aname, AFFO_DIV) and (division="" OR a.division);
  173.       divonly:=True;
  174.     }
  175.     else if (aname[1]='=')
  176.     {
  177.       aname:="";
  178.       // List all areas regardless of division
  179.       i:=AreaFindFirst(a, aname, AFFO_NODIV);
  180.     }
  181.     else
  182.     {
  183.       if (division[1]=' ')
  184.         i:=AreaFindFirst(a, aname, AFFO_DIV);
  185.       else
  186.       {
  187.         tmp:=division+"."+aname;
  188.         i:=AreaFindFirst(a, tmp, AFFO_DIV);
  189.         if (i=False)
  190.           i:=AreaFindFirst(a, aname, AFFO_DIV);
  191.       }
  192.       if (i=False)
  193.         print("Search on '", aname, "' failed.\n");
  194.       else
  195.       {   // It's a division, so list all of it
  196.  
  197.         if (a.division)
  198.         {
  199.           divonly:=True;
  200.           division:=a.name;
  201.         }
  202.         else
  203.         {
  204.           AreaSelect(aname);
  205.           return 0;
  206.         }
  207.       }
  208.     }
  209.  
  210.     // If listing only the division, skip past the division record
  211.  
  212.     if (i and divonly and division[1]<>' ')
  213.       i:=AreaFindNext(a);
  214.  
  215.     levels:=1;
  216.     reset_more(nonstop);
  217.     while (i and do_more(nonstop, COL_CYAN) and levels)
  218.     {
  219.       if (a.division=2)
  220.       {
  221.         if (divonly)
  222.           levels:=levels-1;
  223.       }
  224.       else
  225.       {
  226.         if (divonly and a.division=1)
  227.           levels:=levels+1;
  228.         if (divonly=False OR isourdivision(division, a.name))
  229.  
  230. // added to print and write C:\Max\Miscx\M_Alst03.bbs
  231.  
  232.      if (argv <> "CON") {
  233.      if (cn >0 and cn <10)
  234.          z := "\b";
  235.      if (cn >10 or cn >100)
  236.          z := "\b\b";
  237.      if (cn >100)
  238.          z := "\b\b\b";
  239.      if (cn = 0)
  240.          print("Area # ");
  241.          print(z,cn);
  242.          cn := cn + 1;
  243.       }
  244.  
  245.   fd := open("C:\\Max\\Miscx\\M_Alst03.bbs", IOPEN_APPEND | IOPEN_WRITE);
  246.          line := "";
  247.          if (strupper(substr(a.name,2,2)) = "S" or
  248.              strupper(substr(a.name,1,1)) = "S")
  249.              tmp := "a100/"+substr(a.name,1,1);
  250.          else if (strupper(substr(a.name,1,1)) = "E" and strlen(a.name)=1)
  251.              tmp := "a0/"+substr(a.name,1,1);
  252.          else
  253.              tmp := "a20/"+substr(a.name,1,1);
  254.  
  255.          if (strlen(a.name)=1) {
  256.          if (strupper(a.name)="E")
  257.              line := TMT;
  258.          if (strupper(a.name)="A")
  259.              line := A;
  260.          else if( strupper(a.name)="B")
  261.              line := B;
  262.          else if( strupper(a.name)="D")
  263.              line := D;
  264.          else if( strupper(a.name)="F")
  265.              line := F;
  266.          else if( strupper(a.name)="G")
  267.              line := G;
  268.          else if( strupper(a.name)="H")
  269.              line := H;
  270.          else if( strupper(a.name)="L")
  271.              line := L;
  272.          else if( strupper(a.name)="M")
  273.              line := M;
  274.          else if( strupper(a.name)="N")
  275.              line := N;
  276.          else if( strupper(a.name)="O")
  277.              line := O;
  278.          else if( strupper(a.name)="R")
  279.              line := R;
  280.          else if( strupper(a.name)="T")
  281.              line := T;
  282.          else if( strupper(a.name)="V")
  283.              line := V;
  284.          else if( strupper(a.name)="W")
  285.              line := W;